[IA64] Update PV-on-HVM to follow status of interrupt controller
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Thu, 30 Nov 2006 22:57:20 +0000 (15:57 -0700)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Thu, 30 Nov 2006 22:57:20 +0000 (15:57 -0700)
Follow-on to xen-unstable cangeset:
http://xenbits.xensource.com/xen-unstable.hg?cs=fe5ed694b0c2

    - Follow to change a method of interrupt handling in latest
      changeset.
    - Modify to change the spec of callback IRQ in hypervisor side.
    - Modify to follow status of interrupt mask register of virtual
      interupt controller.
    - Modify to deliver interupts to a CPU specified with virtual
      interrupt controller.

http://lists.xensource.com/archives/html/xen-ia64-devel/2006-11/msg00159.html

Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
Signed-off-by: Kouya SHIMURA <kouya@jp.fujitsu.com>
xen/arch/ia64/vmx/vlsapic.c
xen/arch/ia64/vmx/vmx_process.c

index d2963fdf91f1618f853ea01542ef554c46398b68..2fa0245099ac8329ad1497209921cd591e70a169 100644 (file)
@@ -103,8 +103,10 @@ static int vmx_vcpu_unpend_interrupt(VCPU *vcpu, uint8_t vector)
     ret = test_and_clear_bit(vector, &VCPU(vcpu, irr[0]));
     local_irq_restore(spsr);
 
-    if (ret)
+    if (ret) {
         vcpu->arch.irq_new_pending = 1;
+        wmb();
+    }
 
     return ret;
 }
@@ -488,8 +490,10 @@ int vmx_vcpu_pend_interrupt(VCPU *vcpu, uint8_t vector)
     ret = test_and_set_bit(vector, &VCPU(vcpu, irr[0]));
     local_irq_restore(spsr);
 
-    if (!ret)
+    if (!ret) {
         vcpu->arch.irq_new_pending = 1;
+        wmb();
+    }
 
     return ret;
 }
@@ -511,6 +515,7 @@ void vmx_vcpu_pend_batch_interrupt(VCPU *vcpu, u64 *pend_irr)
     }
     local_irq_restore(spsr);
     vcpu->arch.irq_new_pending = 1;
+    wmb();
 }
 
 /*
@@ -572,6 +577,7 @@ void guest_write_eoi(VCPU *vcpu)
     VLSAPIC_INSVC(vcpu,vec>>6) &= ~(1UL <<(vec&63));
     VCPU(vcpu, eoi)=0;    // overwrite the data
     vcpu->arch.irq_new_pending=1;
+    wmb();
 }
 
 int is_unmasked_irq(VCPU *vcpu)
index 3526175cbd38e0f3d90286fbb99fae795b4c230f..d6c5c295d1512a063885c15ee648d3e533799f83 100644 (file)
@@ -225,15 +225,15 @@ void leave_hypervisor_tail(struct pt_regs *regs)
         if (v->vcpu_id == 0) {
             int callback_irq =
                 d->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ];
-            if (callback_irq != 0 && local_events_need_delivery()) {
-                /*inject para-device call back irq*/
-                v->vcpu_info->evtchn_upcall_mask = 1;
-                vmx_vcpu_pend_interrupt(v, callback_irq);
+            if (callback_irq != 0) {
+                /* change level for para-device callback irq */
+                vmx_vioapic_set_irq(d, callback_irq,
+                                    local_events_need_delivery());
             }
         }
 
-        if ( v->arch.irq_new_pending ) {
-            v->arch.irq_new_pending = 0;
+        rmb();
+        if (xchg(&v->arch.irq_new_pending, 0)) {
             v->arch.irq_new_condition = 0;
             vmx_check_pending_irq(v);
             return;